import ajax from '@/utils/request'

//  获取球员列表
export function getPlayerList(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/page',
		method: 'GET',
		data
	})
}

// 获取学员首页统计信息
export function studentHomeStatistics(id) {
	return ajax({
		url: '/mobile/student/center/newCourseDetail/' + id,
		method: 'GET'
	})
}

// 添加球员
export function addPlayer(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/add',
		method: 'POST',
		data
	})
}
export function editPlayer(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/update',
		method: 'PUT',
		data
	})
}

// 更新学员档案
export function stuUpdateOther(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/stuUpdateOther',
		method: 'POST',
		data
	})
}

export function getStudentProfile() {
	return ajax({
		url: '/dictionary/getUserPaylerProfile',
		method: 'GET'
	})
}
// 球员详情
export function  getPlayerDetial(id) {
	return ajax({
		url: `/mobile/instructor/stu/stu/detail/${id}`,
		method: 'GET'
	})
}

// 球员详情
export function  getStuBindImg(id) {
	return ajax({
		url: `/mobile/instructor/stu/stu/stuBindImg`,
		method: 'GET',
		data: {id}
	})
}

// 球员分组
export function  getPlayerGroup() {
	return ajax({
		url: `/mobile/instructor/stu/stu/group/list`,
		method: 'GET'
	})
}
// 添加球员分组
export function  addPlayerGroup(data) {
	return ajax({
		url: `/mobile/instructor/stu/stu/group`,
		method: 'PUT',
		data
	})
}

// 删除球员分组
export function delPlayerGroup(id) {
	return ajax({
		url: '/mobile/instructor/stu/stu/group/del/' + id,
		method: 'GET'
	})
}

// 即将训练
export function  getStuCourse(data) {
	return ajax({
		url: `/mobile/instructor/stu/stuCourse`,
		method: 'GET',
		data
	})
}

// 教学目标列表
export function getTechingList(stuId) {
	return ajax({
		url: `/mobile/instructor/stu/stu/teaching/page`,
		data: { stuId },
		method: 'GET'
	})
}

// 添加教学目标
export function addTeching(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/addTeaching',
		method: 'POST',
		data
	})
}

// 完成教学目标
export function finishTeaching(id) {
	return ajax({
		url: `/mobile/instructor/stu/stu/teaching/finish`,
		data: { id },
		method: 'GET'
	})
}

// 获取当前目标
export function getCurrentTeching(stuId) {
	return ajax({
		url: `/mobile/instructor/stu/stu/teaching/current`,
		data: { stuId },
		method: 'GET'
	})
}

// 获取历史目标
export function getHistoryTeching(stuId) {
	return ajax({
		url: `/mobile/instructor/stu/stu/teaching/history`,
		data: { stuId },
		method: 'GET'
	})
}

// 修改目标
export function editTeching(data) {
	return ajax({
		url: '/mobile/instructor/stu/stu/updateTeaching',
		method: 'PUT',
		data
	})
}
// 评测接口
// 评测集合首页顶部聚合数据统计

export function getEvaluationIndexHead(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/evalCountList',
		method: 'GET',
		data
	})
}
export function getEvaluationStuList(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/evalStudentList',
		method: 'GET',
		data
	})
}
// 评测列表
export function getEvaluationList(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/list',
		method: 'GET',
		data
	})
}
// 评测历史
export function getEvaluationHistory(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/history',
		method: 'GET',
		data
	})
}
// 我的评测历史
export function getMyEvaluationHistory(data) {
	return ajax({
		url: '/mobile/stu/evaluation/history',
		method: 'GET',
		data
	})
}
// 我的评测统计
export function getMyEvaluationStatistics(data) {
	return ajax({
		url: '/mobile/stu/evaluation/statistics',
		method: 'GET',
		data
	})
}
// 评测详情
export function getEvaluationDetail(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/detail',
		method: 'GET',
		data
	})
}

export function submitEvaluation(data) {
	return ajax({
		url: '/mobile/instructor/evaluation/submit',
		method: 'POST',
		data
	})
}

// 学员课程列表
export function getCourseList(data) {
	return ajax({
		url: '/storehouse/courseStudentPage',
		method: 'GET',
		data
	})
}

// 添加学员课程/计划
export function addCoursePlan(data) {
    return ajax({
        url: '/storehouse/addCourseStudent',
		method: 'POST',
        data
    })
}

// 编辑学员课程/计划
export function editCoursePlan(data, id) {
    return ajax({
        url: '/storehouse/updateCourseStudent/' + id,
		method: 'PUT',
        data
    })
}

// 获取计划详情
export function getPlanDetail(id) {
    return ajax({
        url: '/storehouse/planDetailWithId/' + id,
		method: 'GET'
    })
}

// 添加学员问题
export function addPlayerQuestion(data) {
    return ajax({
        url: '/storehouse/addStuQuestion',
		method: 'POST',
        data
    })
}
// 添加学员问题
export function editPlayerQuestion(data, id) {
    return ajax({
        url: '/storehouse/updateStuQuestion/' + id,
		method: 'PUT',
        data
    })
}

// 学员问题列表
export function getPlayerQuestionList(data) {
	return ajax({
		url: '/storehouse/courseStudentPage',
		method: 'GET',
		data
	})
}

// 学员提问列表
export function getTraineesList(data) {
	return ajax({
		url: '/storehouse/instructorPage',
		method: 'GET',
		data,
		hiddenLoading: true
	})
}

// 学员提问解答
export function questionAnswering(data, id) {
	return ajax({
		url: '/storehouse/traineesAnswer/' + id,
		method: 'POST',
		data
	})
}

// 学员分析
export function getStudentAnalysisHeader(id) {
	return ajax({
		url: '/mobile/student/center/courseDetailAnalysis/' + id,
		method: 'GET'
	})
}

// 问题解决方案
export function problemSolution(id) {
	return ajax({
		url: '/mobile/student/center/problemSolvingDistribution/' + id,
		method: 'GET'
	})
}

// 学员分析
export function problemSolvingAnalysis(id) {
	return ajax({
		url: '/mobile/student/center/problemSolvingAnalysis/' + id,
		method: 'GET'
	})
}

// 学员提问转问题
export function questionToQuestion(id) {
	return ajax({
		url: '/mobile/instructor/index/questionAdd/' + id,
		method: 'GET'
	})
}

// 新建课程包
export function addCoursePackage(data) {
	return ajax({
		url: '/mobile/courselesson/createPackage',
		method: 'POST',
		data
	})
}
// 修改课程包
export function editCoursePackage(data) {
	return ajax({
		url: '/mobile/courselesson/updatePackage',
		method: 'POST',
		data
	})
}

// 课程包列表
export function getPackageList(data) {
	return ajax({
		url: '/mobile/courselesson/getPackageList',
		method: 'GET',
		data
	})
}